<!DOCTYPE HTML>
<!--
	Dimension by HTML5 UP
	html5up.net | @ajlkn
	Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
 <head>
  <title>
   Dimension by HTML5 UP
  </title>
  <!-- <meta charset="utf-8" /> -->
  <!-- <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" /> -->
  <meta charset="utf-8"/>
  <meta content="width=device-width,initial-scale=1.0" name="viewport"/>
  <link href="../../assets/css/article.css" rel="stylesheet"/>
  <link href="https://cdn.bootcss.com/highlight.js/9.15.8/styles/github.min.css" rel="stylesheet"/>
  <noscript>
   <link href="../../assets/css/noscript.css" rel="stylesheet"/>
  </noscript>
 </head>
 <body>
  <div id="app">
  </div>
  <!-- built files will be auto injected -->
 </body>
 <body class="is-preload">
  <!-- Wrapper -->
  <div id="wrapper">
   <!-- Main -->
   <div id="main">
    <article id="article">
     <h1 id="soul">
      Soul 源码解析（二）代码初步运行
     </h1>
     <hr/>
     <h2 id="_1">
      简介
     </h2>
     <p>
      基于上篇：
      <a href="">
       Soul 源码阅读（一） 概览
      </a>
      ,这部分跑一下Soul网关的示例
     </p>
     <h3 id="_2">
      过程记录
     </h3>
     <p>
      现在我们可以根据地图，稍微探索一下周边，摸一摸
     </p>
     <p>
      首先把工程拉下来，大致命令如下：
     </p>
     <p>
      ```shell script
     </p>
     <h1 id="fork">
      fork 代码到自己的参考
     </h1>
     <h1 id="_3">
      拉取代码到本地
     </h1>
     <p>
      git clone xxxxxx
     </p>
     <h1 id="soulpr">
      如果你经常要给soul提交PR，进行学习研究时候建立一个新的专属分支，避免改动后还要改回来，新分支也可尽情改动
     </h1>
     <p>
      git checkout -b read 避免污染原来的代码，影响后面的提交
     </p>
     <h1 id="_4">
      编译测试相关
     </h1>
     <p>
      F:\Software\apache-maven-3.6.3\bin\mvn.cmd clean install
      <code>
       -Dmaven.javadoc.skip
      </code>
      =true
      <code>
       -Dmaven.test.skip
      </code>
      =true
     </p>
     <div class="codehilite">
      <pre><span></span><code><span class="o">&amp;</span><span class="n">ensp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">ensp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">ensp</span><span class="p">;</span><span class="o">&amp;</span><span class="n">ensp</span><span class="p">;</span><span class="n">Soul</span> <span class="k">Admin</span> <span class="err">需要数据，我们简单使用</span><span class="n">docker</span> <span class="err">启动一个</span>

<span class="o">```</span><span class="n">shell</span> <span class="n">script</span>
<span class="o">#</span> <span class="n">docker</span> <span class="err">启动一个</span><span class="n">mysql数据库</span><span class="p">,</span><span class="err">密码</span><span class="mi">123456</span>
<span class="o">#</span> <span class="err">如果之前运行过</span><span class="n">soul</span><span class="err">，重新删除数据库，让其重建，因为后面有改动数据库</span>
<span class="n">docker</span> <span class="n">run</span> <span class="c1">--name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 -d mysql:latest</span>
</code></pre>
     </div>
     <p>
      soul admin 修改配置文件中数据库相关信息
     </p>
     <p>
      运行Soul Admin模块下的主函数，启动 soul-admin
     </p>
     <p>
      运行Soul Bootstrap 模块下主函数，启动 soul-bootstrap，可以看到 websocket 建立同步的相关信息
     </p>
     <p>
      浏览器访问： http://localhost:9095 ,登录 soul-admin，账号和密码是：admin 123456
     </p>
     <p>
      找到插件列表的 divide 插件
    添加选择器
     </p>
     <p>
      <img alt="" src="./picture/selectorconfig.png"/>
     </p>
     <p>
      添加规则
     </p>
     <p>
      <img alt="" src="./picture/rule.png"/>
     </p>
     <p>
      访问 http://localhost:9195/ ,得到 netty的返回结果(另开了一个netty的服务，返回hello world)
     </p>
     <p>
      成功运行！
     </p>
    </article>
   </div>
   <!-- Footer -->
   <footer id="footer">
    <p class="copyright">
     © Untitled. Design:
     <a href="https://html5up.net">
      HTML5 UP
     </a>
     .
    </p>
   </footer>
  </div>
  <!-- BG -->
  <div id="bg">
  </div>
  <!-- Scripts -->
  <script src="../assets/js/jquery.min.js">
  </script>
  <script src="../assets/js/browser.min.js">
  </script>
  <script src="../assets/js/breakpoints.min.js">
  </script>
  <script src="../assets/js/util.js">
  </script>
  <script src="../assets/js/main.js">
  </script>
 </body>
</html>
